package cn.bisoft.java.util.config;

import java.util.HashMap;

import com.hengpeng.common.exception.SystemException;

public class SystemConfig
{
	private final static HashMap<String, Object> hmSysPara = new HashMap<String, Object>();

	public static boolean containsConfig(String key)
	{
		return hmSysPara.containsKey(key);
	}

	public static String getConfigString(String key)
	{
		if (hmSysPara.containsKey(key))
		{
			String value = (String) hmSysPara.get(key);
			return value;
		}
		else
		{
			throw new SystemException("�����ڻ�δ��ʼ��ϵͳ����{" + key + "}...");
		}
	}

	public static Object getConfig(String key)
	{
		if (hmSysPara.containsKey(key))
		{
			return hmSysPara.get(key);
		}
		else
		{
			throw new SystemException("�����ڻ�δ��ʼ��ϵͳ����{" + key + "}...");
		}
	}

	public static void removeConfig(String key)
	{
		hmSysPara.remove(key);
	}

	public static void setConfig(String key, Object value)
	{
		hmSysPara.put(key, value);
	}
}
